package work.shyk.lisbs;

import org.apache.http.Header;
import org.apache.http.message.BasicHeader;
import utils.http.https.HttpUtil;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * description: <br>
 * createTime: 2019/8/2315:11 <br>
 *
 * @author zzh
 */
public class Auth {

    public static void main(String[] args) throws IOException {
        List<Header> headers = new ArrayList<>();
        headers.add(new BasicHeader("cache-control", "no-cache"));
        headers.add(new BasicHeader("Content-Type", "application/x-www-form-urlencoded"));
        try {
            HttpUtil.ResponseEntity responseEntity = HttpUtil.doPostRequest("http://10.246.151.116", headers.toArray(new Header[]{}),
                    "4Tredir=/&magic=040b1f94a25b5f2e&username=t-xiaofang.zhang&password=LarienaMia@789");
            System.out.println(responseEntity.getCode());
            System.out.println(responseEntity.getResponseBody());
        } catch (Exception e) {
        }

        try {
            HttpUtil.ResponseEntity responseEntity = HttpUtil.doPostRequest("http://10.246.151.202", headers.toArray(new Header[]{}),
                    "4Tredir=/&magic=040b1f94a25b5f2e&username=t-xiaofang.zhang&password=LarienaMia@789");
            System.out.println(responseEntity.getCode());
            System.out.println(responseEntity.getResponseBody());
        } catch (Exception e) {
        }
    }
}
